package com.sskj.spk.presenter;


import com.lzy.okgo.model.Response;
import com.sskj.common.base.HttpData;
import com.sskj.spk.bean.LevelVolumeBean;
import com.sskj.spk.ui.fragment.TradeFragmentBb;
import com.sskj.lib.http.JsonCallBack;

import java.util.List;

/**
 * @author Hey
 * created at 2018/4/4 13:34
 */
public class TradePresenterBb extends BasePresenter<TradeFragmentBb> {

    /**
     * 获取成交数据
     *
     * @author Hey
     * created at 2018/4/4 13:23
     */
    public void getTradeList(String code,int page) {

        httpService.getLevelVolumeListBb(code,page)
                .execute(new JsonCallBack<HttpData<List<LevelVolumeBean>>>(false) {
                    @Override
                    public void onSuccess(Response<HttpData<List<LevelVolumeBean>>> response) {
                        HttpData<List<LevelVolumeBean>> bean = response.body();

                        if (bean.getData()!=null) {
                            mView.setData(bean.getData());
                        }
                    }
                });
    }

}
